<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="/static/pear/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form">
    <div class="mainBox  layui-card-body" style="padding: 0 0;">
        <div class="main-container">

            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.name}"  autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">工号</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.userid}"  autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">手机号*</label>
                <div class="layui-input-block">
                    <input type="text" name="mobile" lay-verify="required" value="{$inf.mobile}" placeholder="请输入手机号" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">积分</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.integral}"  autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">email</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.email}"  autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">角色*</label>
                <div class="layui-input-block">
                    <select name="role" lay-verify="required">
                        <option value="1" {eq name="$inf.role" value="1"}selected{/eq}>普通用户</option>
                        <option value="2" {eq name="$inf.role" value="2"}selected{/eq}>HR</option>
                        <option value="3" {eq name="$inf.role" value="3"}selected{/eq}>老师</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">入职时间*</label>
                <div class="layui-input-block">
                    <input type="text" name="in_time" id="date" lay-verify="required" value="{$inf.in_time}" placeholder="请选择入职时间" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">部门</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.department_name}" name="department_name" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">职务</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.position}" name="position" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">Function</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.function}" name="function" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">Division</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.division}" name="division" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">Division(MT)</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.division_mt}" name="division_mt" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Entity</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.entity}" name="entity" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">Entity(MT)</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.entity_mt}" name="entity_mt" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Activity Sector</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.activity_sector}" name="activity_sector" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Region</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.region}" name="region" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Office Location</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.office_location}" name="office_location" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Services Year</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.services_year}" name="services_year" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Age of employee</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.age}" name="age" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Nationality</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.nationality}" name="nationality" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">下属人数</label>
                <div class="layui-input-block">
                    <input type="text" value="{$inf.xiashu}" name="xiashu" autocomplete="off" class="layui-input layui-disabled" disabled>
                </div>
            </div>

            <input type="hidden" name="id" value="{$inf.id}">
            {:token_field()}
        </div>
    </div>


    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
{include file="_Fragment/javascript" /}
<script>
    layui.use(['form', 'jquery', 'element'], function() {
        let form = layui.form;
        let laydate = layui.laydate;
        let $ = layui.jquery;

        laydate.render({
            elem: '#date'
        });

        form.on('submit(user-save)', function(data) {
            let loading = layer.load();
            $.ajax({
                url: '/Members/modify',
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function(result) {
                    layer.close(loading);
                    if (result.status == 0) {
                        layer.msg(result.msg, {
                            icon: 1,
                            time: 1000
                        }, function() {
                            parent.layer.close(parent.layer.getFrameIndex(window
                                .name)); //关闭当前页
                            parent.layui.table.reload("user-table");
                        });
                    } else {
                        layer.msg(result.msg, {
                            icon: 2,
                            time: 1000
                        });
                    }
                }
            })
            return false;
        });
    })
</script>
<script>
</script>
</body>
</html>